package com.spring.controller;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.spring.model.User;
import com.spring.service.UserService;

@Controller

public class LoginController {
	
	@Resource
	private UserService userService;
	
	@RequestMapping(value="/login",method=RequestMethod.POST, produces = "application/json;charset=UTF-8")
	@ResponseBody
	public User login(String username,String password) {
		System.out.println(username+","+password);
		return new User(username, password);
	}
	
	@RequestMapping("/trans")
	public void transMoney(String out,String in,int money) {
		userService.transMoney(out, in, money);
	}
}
